<template>
  <div>
    <!-- 登录页面 -->
    <form action="">
        用户名：<input type="number" v-module="username">
        密码：<input type="password"  v-model="password">
        <button @click="login">登录</button>
    </form>
  </div>
</template>

<script>
export default {
    name:'login',
    data(){
        return {
            username:'',
            password:''
        }
    },
    methods:{
        // 点击登录按钮之后，触发login函数，函数内容是axios想后台发送登录请求
        login(){
            let res = axios.post({
                url:'http://localhost:3007/login',
                data:{
                    username:this.username,
                    password:this.password
                }
            })
        }
    }
}
</script>

<style>

</style>